<template>
	<view class="container">
		<view class="header">
			<view class="user" @tap="toMe">
				<view class="headPortrait">
					<image src="../../static/icon/start.png" mode=""></image>
				</view>
				<view class="name-level">
					<view class="name">
						<text class="name-value">eager</text>
					</view>
					<view class="member-id">ID：020399238289</view>
				</view>
				<view class="rightArrow">
					<image src="../../static/icon/shallowArrow.png" mode=""></image>
				</view>
			</view>
		</view>
		<view class="menu">
			<view class="menu-inner">
				<view class="grid-item" v-for="(item, index) in grid" :key="index">
					<text class="grid-value">{{item.value}}</text>
					<text class="grid-title">{{item.title}}</text>
				</view>
			</view>
		</view>
		<!-- 列表组件 -->
		<uni-list>
			<uni-list-item thumb="../../static/icon/authentication.png" thumbSize="base" title="完善信息" link
				to="../member-detail/member-detail"></uni-list-item>
			<uni-list-item thumb="../../static/icon/history1.png" thumbSize="base" title="上传记录" link
				to="../member-detail/member-detail"></uni-list-item>
			<uni-list-item thumb="../../static/icon/evaluate.png" thumbSize="base" title="我的评价" link
				to="../member-detail/member-detail"></uni-list-item>
			<uni-list-item thumb="../../static/icon/shoppingMall.png" thumbSize="base" title="推荐商城" link
				to="../member-detail/member-detail"></uni-list-item>
			<uni-list-item thumb="../../static/icon/site.png" thumbSize="base" title="关于我们" link
				to="../member-detail/member-detail"></uni-list-item>
			<uni-list-item thumb="../../static/icon/share.png" thumbSize="base" title="分享我的" link
				to="../member-detail/member-detail"></uni-list-item>
			<uni-list-item thumb="../../static/icon/service.png" thumbSize="base" title="在线客服" link
				to="../member-detail/member-detail"></uni-list-item>
		</uni-list>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				grid: [{
						value: 8,
						title: '优惠券'
					},
					{
						value: 3556,
						title: '积分'
					},
					{
						value: 16,
						title: '卡项'
					},
					{
						value: 24,
						title: '收藏'
					}
				]
			}
		},
		methods: {
			toMe() {
				uni.navigateTo({
					url: '../member-detail/member-detail'
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.container {
		.header {
			width: 100%;
			position: relative;
			flex-direction: column;
			align-items: center;
			height: 400rpx;
			overflow: hidden;
			box-sizing: border-box;

			.user {
				width: 100%;
				display: flex;
				align-items: center;
				justify-content: space-between;
				color: #fff;
				padding: 40rpx;
				box-sizing: border-box;

				.name-level {
					flex: 1;
					margin-left: 20rpx;

					.name {
						.name-value {
							font-size: 40rpx;
							margin-right: 8rpx;
						}

						.member-id {
							margin-top: 20rpx;
							font-size: 28rpx;
						}
					}
				}

				.headPortrait image {
					width: 130rpx;
					height: 130rpx;
					border-radius: 50%;
				}

				.rightArrow image {
					width: 45rpx;
					height: 45rpx;
				}
			}
		}

		.header::after {
			content: '';
			width: 140%;
			height: 320rpx;
			position: absolute;
			top: 0;
			left: -20%;
			border-radius: 0 0 50% 50%;
			background: linear-gradient(1deg, rgb(4, 129, 121) 0%, rgba(51, 166, 158, 1) 100%);
			z-index: -1;
		}

		.menu {
			position: absolute;
			top: 200rpx;
			width: 100%;
			height: 160rpx;
			padding: 0 40rpx;
			box-sizing: border-box;

			.menu-inner {
				width: 100%;
				height: 160rpx;
				border-radius: 20rpx;
				background: #fff;
				border: 1rpx solid #f5f5f5;
				display: flex;
				align-items: center;
				justify-content: space-between;

				.grid-item {
					display: flex;
					flex-direction: column;
					align-items: center;
					padding: 0 40rpx;

					.grid-value {
						font-size: 32rpx;
						font-weight: 1000;
					}

					.grid-title {
						margin-top: 16rpx;
						font-size: 32rpx;
						color: #8f8f8f;
					}
				}
			}
		}
	}
</style>
